From 52349beb922e1c37d9d20cddb5998d444fe27e7f Mon Sep 17 00:00:00 2001 From: Raymond Penners Date: Sat, 18 Oct 2003 20:37:30 +0000 Subject: [PATCH] Grippers --- modules/engines/ms-windows/ChangeLog.old | 5 +++++ modules/engines/ms-windows/wimp_style.c | 6 ++++-- modules/engines/ms-windows/xp_theme.c | 18 +++++++++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/modules/engines/ms-windows/ChangeLog.old b/modules/engines/ms-windows/ChangeLog.old index 5fb487e567..4c24ffe15c 100755 --- a/modules/engines/ms-windows/ChangeLog.old +++ b/modules/engines/ms-windows/ChangeLog.old @@ -1,3 +1,8 @@ +2003-10-18 Raymond Penners + + * src/*: Attempted to fix the grippers for the GNAT Programming + System. Things behave a tiny bit better now. See #ifdef GNATS_HACK + 2003-10-17 Raymond Penners * src/wimp_style.c: Horizontal/vertical scrollbars were mixed up, diff --git a/modules/engines/ms-windows/wimp_style.c b/modules/engines/ms-windows/wimp_style.c index 57f39cbcac..74b8434b03 100755 --- a/modules/engines/ms-windows/wimp_style.c +++ b/modules/engines/ms-windows/wimp_style.c @@ -1508,10 +1508,12 @@ draw_handle (GtkStyle *style, gint height, GtkOrientation orientation) { - XpThemeElement hndl; - if (!GTK_IS_HANDLE_BOX (widget)) { + XpThemeElement hndl; + + sanitize_size (window, &width, &height); + if (orientation == GTK_ORIENTATION_VERTICAL) hndl = XP_THEME_ELEMENT_GRIPPER_V; else diff --git a/modules/engines/ms-windows/xp_theme.c b/modules/engines/ms-windows/xp_theme.c index 24239c7f73..6e2acffdad 100755 --- a/modules/engines/ms-windows/xp_theme.c +++ b/modules/engines/ms-windows/xp_theme.c @@ -303,7 +303,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state) case XP_THEME_ELEMENT_REBAR: case XP_THEME_ELEMENT_GRIPPER_H: case XP_THEME_ELEMENT_GRIPPER_V: - ret = 0; + ret = CHEVS_NORMAL; break; case XP_THEME_ELEMENT_CHEVRON: @@ -661,6 +661,22 @@ xp_theme_draw (GdkWindow *win, XpThemeElement element, GtkStyle *style, return FALSE; part_state = xp_theme_map_gtk_state(element, state_type); + +#ifdef GNATS_HACK + if (element == XP_THEME_ELEMENT_GRIPPER_V + || element == XP_THEME_ELEMENT_GRIPPER_H) + { + /* Hack alert: when XP draws a gripper, it does not seem to fill + up the whole rectangle. It only fills the gripper line + itself. Therefore we manually fill up the background here + ourselves. I still have to look into this a bit further, as + tests with GNAT Programming System show some awkward + interference between this FillRect and the subsequent + DrawThemeBackground(). */ + FillRect (dc, &rect, (HBRUSH) (COLOR_3DFACE+1)); + } +#endif + draw_theme_background_func(theme, dc, element_part_map[element], part_state, &rect, pClip); gdk_win32_hdc_release(drawable, style->dark_gc[state_type], 0); -- 2.30.2